// SheetSetting.cpp : implementation file
//

#include "stdafx.h"
#include "ECGWorkStation.h"
#include "SheetSetting.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CSheetSetting

IMPLEMENT_DYNAMIC(CSheetSetting, CPropertySheet)

CSheetSetting::CSheetSetting(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
	AddPage(&m_pageGeneral);
	AddPage(&m_pageCOM);
	AddPage(&m_pageHospInfo);
	AddPage(&m_pageDICOM);

}

CSheetSetting::CSheetSetting(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
}

CSheetSetting::~CSheetSetting()
{
}


BEGIN_MESSAGE_MAP(CSheetSetting, CPropertySheet)
	//{{AFX_MSG_MAP(CSheetSetting)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CSheetSetting message handlers

BOOL CSheetSetting::OnInitDialog() 
{
	BOOL bResult = CPropertySheet::OnInitDialog();
	
	SetActivePage(3);
	SetActivePage(2);
	SetActivePage(1);
	SetActivePage(0);
	//this->m_psh.pszCaption;
	GetDlgItem(IDOK)->SetWindowText("OK");
	GetDlgItem(IDCANCEL)->SetWindowText("Cancel");
	
	return bResult;
}
void CSheetSetting::SaveSetting(void)
{
	m_pageCOM.SaveSetting();
	m_pageHospInfo.SaveSetting();
	m_pageGeneral.SaveSetting();
	m_pageDICOM.SaveSetting();
}

BOOL CSheetSetting::PreCreateWindow(CREATESTRUCT& cs) 
{
	// TODO: Add your specialized code here and/or call the base class
	
	DWORD   dwStyle   =   GetWindowLong(this->m_hWnd,   GWL_STYLE);   
	dwStyle   |=   (WS_SIZEBOX);    
	dwStyle   |=   (WS_MAXIMIZEBOX);   
	dwStyle   |=   (WS_MINIMIZEBOX);   
	SetWindowLong(this->m_hWnd,   GWL_STYLE,   dwStyle);   
    
	 

	return CPropertySheet::PreCreateWindow(cs);
}
